package com.ruoyi.web.controller;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 电话号码标签
 */
@Controller
@RequestMapping("/system/MytestDemo")
public class PhoneNumberController {

    @PostMapping("/PhoneLabel")
    @ResponseBody
    public String getType(@RequestParam("phone") String Phone) {
//        String Res="";
//        String url="http://s6.cscmjc.com/api/pc/sogou.php?q="+Phone;
//        try{
//            Document document = Jsoup.connect(url).get();
//            Elements element =document.getElementsByClass("title-info");
////            System.out.println(document.getElementById("sjyi").text());
//            Res=document.getElementById("sjyi").text();
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return Res;
        if (Phone.equals("")) {
            return "正常用户,该手机号是浙江";
        } else if (!Phone.equals("")) {
            return "该用户标签是快餐快递,该手机号是浙江";
        } else {
            return "";
        }
    }
}
